package ooday01test;

public class Student {
    public String name;
    public int age;
    public String className;
    public String stuId;
    //构造方法
    public Student() {
    }
    //有参构造方法
    public Student(String name, int age, String className, String stuId) {
        this.name = name;
        this.age = age;
        this.className = className;
        this.stuId = stuId;
    }
    public void study(){
        System.out.println("学习");
    }
    public void sayHi(){
        System.out.println("大家好，我是"+name+"，今年"+age+"岁了，我是"+className+"班的，学号是"+stuId+"。");
    }
    public void playWith(String anotherName){
        System.out.println(name+"和"+anotherName+"一起玩");
    }
}
